package com.dc.project.sales.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.dc.common.validated.DeleteGroup;
import com.dc.common.validated.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 销售订单表(SalOrder)实体类
 *
 * @author zhuangcy
 * @since 2021-06-23 14:26:17
 */
@TableName("sal_order")
@Data
@ApiModel(value = "销售订单表")
public class SalOrder implements Serializable {
    private static final long serialVersionUID = -54180322122728154L;
    /**
     * 销售订单id
     */
    @NotNull(message = "销售订单id不能为空", groups = {UpdateGroup.class, DeleteGroup.class})
    @TableId(value = "order_id", type = IdType.AUTO)
    @ApiModelProperty(name = "orderId", value = "销售订单id")
    private Integer orderId;
    /**
     * 单据号
     */
    @TableField(value = "doc_code")
    @ApiModelProperty(name = "docCode", value = "单据号")
    private String docCode;
    /**
     * 单据日期
     */
    @TableField(value = "doc_date")
    @ApiModelProperty(name = "docDate", value = "单据日期")
    private Date docDate;
    /**
     * 客户id
     */
    @TableField(value = "clientele_id")
    @ApiModelProperty(name = "clienteleId", value = "客户id")
    private Integer clienteleId;
    /**
     * 客户名称
     */
    @TableField(value = "clientele_name")
    @ApiModelProperty(name = "clienteleName", value = "客户名称")
    private String clienteleName;
    /**
     * 销售人员id
     */
    @TableField(value = "salesman_id")
    @ApiModelProperty(name = "salesmanId", value = "销售人员id")
    private Integer salesmanId;
    /**
     * 销售人员
     */
    @TableField(value = "salesman")
    @ApiModelProperty(name = "salesman", value = "销售人员")
    private String salesman;
    /**
     * 合计金额
     */
    @TableField(value = "total_amount")
    @ApiModelProperty(name = "totalAmount", value = "合计金额")
    private BigDecimal totalAmount;
    /**
     * 备注
     */
    @TableField(value = "remark")
    @ApiModelProperty(name = "remark", value = "备注")
    private String remark;
    /**
     * 状态
     */
    @TableField(value = "status")
    @ApiModelProperty(name = "status", value = "状态")
    private String status;
    /**
     * 创建者id
     */
    @TableField(value = "created_id", fill = FieldFill.INSERT)
    @ApiModelProperty(name = "createdId", value = "创建者id")
    private Integer createdId;
    /**
     * 创建者
     */
    @TableField(value = "created_by", fill = FieldFill.INSERT)
    @ApiModelProperty(name = "createdBy", value = "创建者")
    private String createdBy;
    /**
     * 创建时间
     */
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @ApiModelProperty(name = "createdTime", value = "创建时间")
    private Date createdTime;
    /**
     * 更新者id
     */
    @TableField(value = "updated_id", fill = FieldFill.UPDATE)
    @ApiModelProperty(name = "updatedId", value = "更新者id")
    private Integer updatedId;
    /**
     * 更新者
     */
    @TableField(value = "updated_by", fill = FieldFill.UPDATE)
    @ApiModelProperty(name = "updatedBy", value = "更新者")
    private String updatedBy;
    /**
     * 更新时间
     */
    @TableField(value = "updated_time", fill = FieldFill.UPDATE)
    @ApiModelProperty(name = "updatedTime", value = "更新时间")
    private Date updatedTime;

    /**
     * 单据类型
     */
    public static final String DOC_TYPE_NAME = "sal_order";

    public String getDocTypeName() {
        return DOC_TYPE_NAME;
    }
}